﻿using System;
using System.Drawing.Imaging;
using Library.Components;

public partial class Controls_Common_RandomCaptCha : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var objStr = new CString();

        var sRandom = objStr.RandomString(5, false, false);
        Session["SecuritySession"] = sRandom;

        var ci = new SecurityImage(Session["SecuritySession"].ToString(), 200, 50, "Arial");

        Response.Clear();
        Response.ContentType = "image/gif";

        ci.Image.Save(Response.OutputStream, ImageFormat.Gif);

        ci.Dispose();
    }
}